More AI fixes

Still not perfect