Fixed weired RandomAI crash

I do not exactly know why it crashed or why it does not crash now, but
it seems to work fine...