Fix handling of nested query values