Fixing list-based query encoding