Rewrited padding calculation for containers.