Balancing brackets in code editor,  and other bug fixes.