Lots of aiObject bugfixes