Cleanup unused files. More error checking (WIP).