Fix some bugs in the opportunist AI