More random bugfixes