Add special case handling for calloc and realloc