Remove a couple of null checks in SqlFunctions. Add tests for null semantics. Fix formatting.