mod/reader small optimizations to code and fixing typos in comments