Fixed grammar editor closing bug