Bugfixes, error reporting, stuff