Minor bugfixes etc.