Fixes for 500 error to not be treated like 404