fixed many small bugs after testbed deploy