fixing NPE in test classes