Fix NULL function pointer check, remove dead functions.