better support for array casting