protocol fixes

now protocol v3 seems to work.