Improve the WSGI test a bit and fix some silly bugs discovered in the
process.