Fixed a bug with index bounds checking