Fixed some logical errors in the boolean functions
Merge remote-tracking branch 'origin/master'