[mod] more robust type fixing