Added realpath to dirname usages