mostly fixed, just 2 more to go for clean compile