Added support for specifying return fields in queries