Resolve file output issues, add config options