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

Added realpath to dirname usages
Duplicate fix #770 to correct branch
Merge branch 'v1.1' into v1.1-with-array-filtering