Fixed one bug -- incorrectly calculating padded size.