Minor code cleanup in assignLayers().