Fix NOTICE for implicit conversion to string in >5.3
Use dirname instead of __DIR__ for backwards compatibility with 5.2