Fixed typo - changed $Query to $query (fixes #6957)