Sex allocation in a group-living simultaneous hermaphrodite: effects of density at two different spatial scales.