Avoiding a potential devide by zero if a device reported an expected hashrate of zero.
Converting several 32bit integers to 64bit
Fixing potential infinate loop when recieving new work with the AlwaysRestart flag set.