Fixed export renaming

Fixed a bug that searched external table with internal name (patch
from enami).  Also added a check to see if 'export' overrides the
previous exports.