Classic protocol and crypto cleanups.

The purpose is exactly as you figured out. Will fix the capitalisation.