Emi - various bugs fixed