Fix closing insertion of unpaired brackets