Bug fixes for drag and drop