More informative error message when credentials are missing + other improvements