Improved track handling but broken now
Fixed the number of tracks issue where the number would not be incremented in the header of the file.