Fixed bug in CustomArrayClass template (incorrect conversion to script value) leading to crash in debug version.