General bug-fixing WP1

Consult the individual commits for further review. *

--

* Commit 80cca23fc0db2d9383f363b0bdfd2a94e504e433 ("Update build scripts") is the result of running `/utils/build_debug.sh`, `/utils/build.sh` and `/tests/builder.sh` only and contains the fixes from the previous commits also provided in this bug-fixing work package.