fixed several bugs related to the use of umask