Updates to support running under gunicorn.