Fixed build scripts and dependency management