fixed infinite loop with getAllTables; added amiVersion for EMR