Removed end-of-document garbage detection. Fixed some typos
Removed end-of-document garbage detection. Fixed some typos