Fix java AI's getCustomParams

ATTN: Possible fix. Didn't properly test it.
Also don't know if reference to object replaced by SetObjectArrayElement should be somehow deleted manually.