changed dynamic memory allocation of function pointers to calloc instead of malloc

Fixed types of functions to match type of function pointer