Fix linking for directories