Improved error handling & temp. file cleanup
Only re-encrypt if the cleartext is modified