Fix typo: RegEp -> RegExp
Merge pull request #858 from reezer/patch-1

Fix typo: RegEp -> RegExp
Only open a new socket for HA if the current socket is dead #859 and #857
Changed to use checkoutReader #859 and #857
Merged in and resolved issues from master