Simplify Response handling in wsgi_app, fix minor bugs