fixed some buges.
Merge pull request #3 from hhatefi/rewards

Merged fixed some bugs from Hassan.