various fixes about padding