Clean up quoting of keys, and make dereferencing more consistent.