Only apply default count if there is no query (fixes issue introduced in adb8a54e263c8023fd6757c0a41ead104cedf9bd)