A couple of minor bugfixes