Changes mainly for DendroPy 4 compatibility