Correct memory allocation so that everything is initialized to zero.