Couple of bugfixes