Complete build scripts
Fix some quality flaws