Add fix from kionez for 'Incorrect padding' error