Improve tests. Fix bugs.

Change-Id: Ic9deaebf802aa3569e148550574c1acc310e12c0
Signed-off-by: Scott Mann <smann@noironetworks.com>