Small typo corrections and code cleanup