Port stuff from cm-11