a couple of small bugfixes and changes