Added check for arrays in queries for setting the param type