Code improvements and updated dwarf model.