Bugfixes & better error reporting.