Schema change and query cleanups