a couple of bugfixes