Fix key check for setter when given an object