Fix issue regarding removing nodes without edges. Remove unused commented code