Minor - Adding missing variable
Fixing queries see #7440
Minor - format code.