This change sets umask to 0022 and restores it afterwards to the standard umask. This works around issue