Fixed check for text index
Added functions to export gate
Removed deprecated functions