Minor typo fix and code clean up