fixed padding (cherry pick of fix by Andreas Schildbach)