Careful that this seems not to be the proper API for fs.mkdirSync(), isn't?

See: http://nodejs.org/api/fs.html#fs_fs_mkdirsync_path_mode

If I'm right, could you also please check whether we wrongly invoke mkdirSync also in other places of the tree? I wonder whether this line of code was written from scratch or was copied from somewhere else.