Fix issue with badly configured node
Check JID node is NULL or empty
Merge pull request #21 from surevine/master

Minor fixes