Fixing null issue

Lesson learned: not all versions have an endpoint.

+ bonus 'undefined has no method indexof' fix