Proper fix to index of bounds