Bug fixes in AIClient.py