Fix build for Mac.

- Various clang erros.
- Fix the build of the sysapps unit tests grabbing dependencies not
needed (they will be included elsewhere).