Fix build.log saving failure