fix some boolean issues