Some updates to ai_cmd.c