Fixed weird drag-to-sort but

Simplified the code in the process.