open statements insertion position bugs fixed