fix logical error in build script
fix RMI connection errors in testing environment