Bugfixes, improvements