Reworked 'map' foreign procedure