Emi - various bug fixed