Small fixes were necessary to run today on macOS. I've also added some debugging `console.log` around to understand better what is going on.