small mods to testbed.R