More tests, fix bug: esc_flag not cleared