Fix a bug with pure being able to index out of bounds