Fix errors and clean directory