Remove some unnecessary code and fix a WSGI handling bug.