Replaced __DIR__ with dirname(__FILE__) for PHP 5.2 compatibility.
Fixes #26.