My fixes.
Hmm, probably not the best way to fix this assert...