Changed some calls to remove some malloc calls.