Fix decision tree nil edge case and add more test coverage.