Fix errors and style