Some protocol fixes + debugging.
Debugging has to be removed later!