Add debug format
Add array check for each result and implode only if it is an array
Merge remote-tracking branch 'origin/develop' into develop