Added more verbose error logging.