Switch over to using calloc from malloc/memset and check returns when possible