better error reporting, improved tests, bug fixes etc