Fix undefined index when running test suite