Fixes bug in handling query params