Fix MDI issues.
Merge pull request #1021 from openscad/mdi-fixes

Fix MDI issues.
Merge branch 'master' into issue347