Fixed typo and inconsistent conditionals