Fixing serialization to always encrypt. Made the version reading more robust