Added some code to show a better error message on failure.