fix some assertion errors