Fixed dragging and selecting bugs