Fix errors relating to normal poll() usage (only MacOS affected).
Additional MacOS fixes.