Fix more bugs related to buildepoch.sh