Changed check for `q` to proper convention.