Fix: make sure to resolve dirname correctly