fix for uwsgi not restarting and other generel improvements