Fix index sould return undef on out of bounds.