Fixed single element + trailing slash check

elemId is returned as an empty string, not undefined or null
The previous checks resulted in a false positive.