Fixed typo and code cleanup