Updated tester to remove potential null pointer dereferences