Workaround with a cp bug on some OSX versions