Improve on the 'invalid object' error message at commit time