Fix panic when bad query params are given