Added a check that the param is not [] before all the functions performing queries
Modified the error messages