Fixed crashes with queries being too large.