Update algorithms and tests to remove free-floating nodes

This addresses #207.