Minor changes in resolve NPE in some test cases