fixing non-deterministic test; general house keeping.