Fixing some query controller issues.