Yet more bugfixes