fix lexer buffer init, mark connect as closed on session close