Add NULL protected to all functions.