null pointer exceptions in tests fixed