Grail fixes

Hi Max!

I don't know if you are still interested in Grail, but I've made a few fixes so it doesn't throw exceptions all the time. It can even search Google successfully now. :-)

Martin