Fix bug wherein dragging to edges causes activities to pop into incorrect order