Return 404 instead of 500, if the file was not found

See commits for the details.

This PR is based on #43.