Initialize header output and output path opening with correct parameters