complete 2nd round of bugfixes