Making the file structure bulletproof

Ain't gonna be no inconsistencies when I'm done.