Small optimizations for some getters.

There is no need to check if an index is in range. Let the caller check it.
It's possible to avoid multiple checks this way.