Just some fixes and I've found some errors in the AI in particular cases :/