toArrayParams fails if there are no params
Merge pull request #1 from csimi/noparams-fix

toArrayParams fails if there are no params