logic for converting shape unit types; fixes #20