bugfix in CompileIM