Fixed bug where updating an instance pointed the underlying instance to the wrong key