Fix incorrect padding

@semihalev, please confirm that this fixes the problem.