some improvements for the zero-hashrate fix, and more debug output