Fix arguments when calling magic method through call_user_func_array.

Associative arrays turn into numeric arrays.

Related to issue #938. I have added tests and appear not to have broken anything else.