Fix bug when AI directory for debug output doesn't exist.