Improve/fix the way padding is handled.