CGI bug fixes