Crowdsale fixes

fix #818 fix #817