Minor fixes to some previous commits.
* Fixed a bug with storing the protocol version.
* Fixed an issue with text windows cancelling.
* Fixed a typo in the source.