Added realpath to dirname usages
Merge pull request #767 from bobvandevijver/dirname-v1.1

Added realpath to dirname usages