Fixes to enable SNAP to link and build on *nix/Mac.