Fixed population mismatch issue.

Replaced the == operator for Integer objects with .equals().
Changed the order of evaluation for a short-circuited AND expression.