Some AI and debug stuff.