Bugfixes, minor improvements.