fix some nonlogic errors