Fixed autoquery when no query function is present