Fix errors and padding