Fix successful build detection logic