Fix for array to string conversion error

Fix for array to string conversion error when the $value variable has nested levels of arrays.