cleanup, typo and bug fix