Debugged index error.