fix crash
slight optimizations to AI that's dumber than i'd hoped