Fix for 2nd part of issue #424.

This is a backport from DMD 2.065.
Merge branch 'master' into merge-2.064
Add test for issue #513