Fixed typo and cleanup code.