bugfixes: divide by 0 error in scheduler for ratiowatch, fix for sql error in peerlist