Fixed badly placed assert