Fixed error reporting (list indices must be integers)