Fix issues passing the junit tests when running in remote mode.