Fixed up some of the boolean clause logic