Check if the item is an array.
Add tests for #2433
Merge branch 'glorand-master'

Fix Hash::extract() operating on non-array data.

Closes #2433