Improved support for detecting and recrypting legacy files. Bugs remain.