Fix and clean types