Fixing out of bounds error in GetKey()
Merge pull request #4962

6f3ae9b Fixing out of bounds error in GetKey() (ENikS)