reduce_heads(): protect from duplicate input