add a couple of bugfixes