fixed a few other bugs found whilst testing with ppcoind