Bugfixes
Output to file scratch