Fixes #350 - edge cases in `@import` processing.