Filtering illegal moves in commander.