Implement support for arrays in custom variables

fixes #6544