Minor fixes

Changed index > size to index >= size and some typos in comments