Add copy file/directory function and some other little modifications.