Bugfix for untriedMoves

Thanks to Daniel Yule who found and submitted a patch for this.