Fix for writing petitions with many signatures + utf8 encoding