Fixes #11 - wrong variable in elemExists check