Fix IndexOutOfBoundsException in ResultSetMetaData

Previously this had an off-by-one error.