Fix problem where 500 errors occur when files do not exist