Bug fix and code improvement in View.onDrop