Fix dirname call