cleanup object instance creation - return correct error messages for types - don't dump undef html before error message