Fix possible issues with dumping of some object types.