Replace instances of __file__ with inspect.getfile()