Fixed encodings issue, allow 3rd arg to specify file output