fixed spurious before and after elements.