fixes and improves for uwsgi