Fix errors, cleanup.