Add $__dirname support