Script was operating on 2 different filenames and would not work.
Sorry for the big commits with bad logs, it was some really tiresome job :)