Fix error handling to catch NotFound exceptions
Merge branch 'master' into staging