Improved handling of cubex exceptions, and improved output for exceptions