last round of bugfixes