Fixed dirname error