Made debug info go to stderr instead of stdout so it doesn't mess up the http headers when run as a cgi script.