Fixed ai discard bug.