Fix handling of instance not found and distinguishing errors in
invocation.  Better error handling.