typo and bug fixes