Minor change to parser and fixed menu close when dragging