Fix for handling json object or array as input
Merge branch 'malog84-master'