Fixed some inequality bugs