Tried to fix some test cases....
Avoid NPE from debug statement
trying to fix test cases. ....