fix build system and small error in Type