a few bugfixes, improvements