Fix error getting array fields

Fixes #3000