A few minor bugfixes