complete a round of bugfixes