More granular error checking. EP_HOST defined not working correctly, need testing