Do these change take into account that the real info is at val.value?  I'm assume that val.to_s might be handling it when query_vars are present but if they aren't then it looks like val instead of val.value is getting returned.