Prevent 404 in case the repository in empty, create a proper error. Fixes #305