Fixing really dumb index-out-of-bounds