More general pad functions.