Fixed build all, fixed program not returning errorcode in some cases of failure.