Skip unnecessary NULL checks
Improve error handling in repo_new_with_backend
Remove a stray * in a comment