Fix fit tests & make them aware of stats tracker

Also fix few bugs revealed by them