Fix a bug with invalid URL
Fix a bug with unexpected errors