Improved tests and added additional checks for NULL pointers.

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