Remove index errors, close #272