updates logic to expand the key when the value is an object (it shouldn't care!). adds tests