Replaced __dir__ with File.dirname(__FILE__) to support 1.9