Fixes dirtification and undirtification of objects.