Fixed another 'Undefined offset' problem