Added systematic tests for index.min|max.
Fixed key increment overflow bug and added tests.