[TASK] Build improvements and a few bugfixes