fixed bug related to the get_*_by_index(..) functions
added support for file exporting