Fix handling of 404 errors

#207