Added resize and pad methods.