Corrected logic in in ElementHelper.areEqual around null args and added tests #487