Added some utility methods prior to refactoring. Changed bitwise ANDs to...

... boolean ANDs.