Query is not assumed to be nil if there is no query. Fixes 500 on /.