Improve handling of CM modules