Fixing dirname basepath