fix deftype macro and emit for new