Some more changes to provide correct uwsgi support