Fixed a bug which caused plain text to be recovered improperly.