Cleaned up and fixed a few tree linearization issues

All probabilities are now generated correctly, plus the success rate. There still was an issue with long trees that weren't linearized correctly - and this is now solved.