Fix for moving box on first selection

Backported a fix from another fork, this fixes issues #830 & #988