Fix encoding issues when outputsize is not specified.