Make dwarf work again with some minor tweaks