Fix invalid assertion hack

Signed-off-by: Ondrej Kupka <ondra.cap@gmail.com>
Finished feature 54899622/invalid-assertion-hack-incorrect.