Add checks to AST constructors. Allow null for empty lists.