Fixed GetLastValue & GetLastKey

As stated in in issue 353 they don't work correctly because they trying to find the next index of the last value/key which doesn't exist.
Merge pull request #489 from clrksml/patch-2

Fixed GetLastValue & GetLastKey