Bug fix---used the wrong padding on encoding.