Fixed several bugs in SwiftTextToImage class.