Worked a first solution on an issue on Mac.
Cleaned up code in write.licor function.