Fix ATR-20893 and ADHI-4796. - fix processing of last event in file in emulator mode - fix Py3 print formatting