Fixes an issue: for access array values

Fixes an issue if the $tmp value becomes an array or object for some reason.

Kind Regrads
Daniel