Bigfixes and improvements for query params processing
Merge branch 'qs-bugfixes' into dev