Replaced occurrences of __DIR__ with dirname