Add asserts to fix flashing