fix issue302

https://code.google.com/p/bitcoinj/issues/detail?id=302

Took into account the last remarks, let me know if some more work is needed on this.