Merge pull request #3155 from Zuhayr/master

Bug fixes.
Fixes #3145
Fixes #2815
Fixes #3146
Fixes #3154
Merge pull request #3159 from Zuhayr/master

AIize() runtime fix.
Merge pull request #4 from Baystation12/master

Pull