Unicode fixes, and changes to error handling