Fix legacy map importer.

Fixes #6143.