Improvements to port map checking
Fix crash in sem_globally_static