Fix a typo and use a better way to check Boolean