CGI for bots

Applying fixes made by Stefan