Added sanitization and preparing for saving.