Fix assert logic