Merge pull request #600 from globecsys/master

PubSub integration
Use exceptions instead of assertions for protocol errors.
Fix 64-bit compilation.