Improve value converter and dispose query results as early as possible.

Change-Id: I26566390cf9f3f1183235e38d1c53fff921a6a0a