Add GREATEST(x, ...) to sqlite to support sqlcounter
Fix formatting and typo