fix some miner bugs