Fixes bug with different fields in query and scan commands

Closes-bug: #1337274
Change-Id: Ic91228c3a78fc016ceb76d8ef2dad880d0784dbf
Merge "Fixes bug with different fields in query and scan commands"