Bugfixes in object.c