Fix lexer; close all open blocks