Another round of bugfixes