Better swallow_elem implementation.