Fix crash when searching empty query; render query when loading it from a file