bug fix in core.element()