Fix out of bounds exception
Merge pull request #1 from MasterEjay/patch-1

Fix out of bounds exception