Fix nil q when no query