Issue #1364: Make exported and global directive work together better