Proper index oob exceptions.

Take that, JDK!
Merge branch 'origin/master'