Removed $localname.
Optimized base path operations.

Normalize only when the baseDirectory is set.

Doesn't include the directory name in the files.