fixes for cgi