Fix proe pad for the case where length is s.length - 1

pad('aaa', 2) erroneously returned 'aaa'