Fix some asserts unhidden by a debug compile