Updated to throw exception when using predicate with string keys