Replace some assert() with actual code

This is related to the planned HHVM switch. assert() depends on a
setting. It may do nothing but should in these cases.

Change-Id: Ic5548eba2e0b673bd5c937bfc8c7c82915de014c
Merge "Replace some assert() with actual code"