Changing typeof check to look to module instead of exports to prevent accidental undefined error.