Fixes some bugs with grain targeting.
Fix.
Merge pull request #3969 from kjkuan/grains-targeting-bugfix

Fixes some bugs with grain targeting.