Fix issues: checking equality on documents with a range key should take the range value into account, correct behaviour of documents when used as keys in a Hash