Update query on whitespace change. Fixes #879.