more robust dwarf handling and better output