Fix up error reporting for restore and fix a bug with type of appVersion