Changes to work with mod_wsgi properly