batch of bugfixes