Add null checks to opaque root APIs.