Using calloc instead of malloc to suppress valgrind memory errors