fix assert() conditions