updated for p2pool, minor bug fixes