Lots of fixes for handling errors in the interface.