Prevent duplicate and redundant moves.
Prevent duplicate and redundant moves.