Clean up files and fix errors