[CLEANUP] Fixes to the build scripts.

@diogofscmariano please review.