Small changes for uwsgi compatablity