Uwsgi

Fixes uwsgi on v1. Should be merged to the 1.0 branch.