More fixes to scatter/compact/balanced topology code.