fix for undefined coming from somewhere in the typescript compiler internals