BF: Various fixes for build_pkg