Add support for padding and truncation.