bugfixes, mostly