update wallet debug printing, fix output_reference hash method