Improved max length for padding