A couple of small improvements and bugfixes