typo bug and cleanup