doc-count-errors - partial fix for variables due to bugs when updating existing query