Correct typos in sql files.
Add distinct keyword to pileup merging.