Changed working directory, added copying of res to output directory