Fix function name type and remove redundant NULL check