Fixed some problems with weighted version of mining