Prepare directories.