Fixed bug causing invalid index values