Improving the boolean check.