Fixing a bug with previous fix for issue #203. Also trying to fix a rare nullpointer exception in drag and drop.