a few bugfixes