Copied from Rserve root.