- Fixed crash when trying to encode empty string.
- Fixed crash when trying to save before generating an image.