#146 Explicitly check if element id is null or undefined
Merge pull request #147 from testobject/master

Fix for #146