Yet more fixes, nearly done