improve error message when registering objects with unitialized fields