Removing NullPointerException handling and fixing test mock objects that triggered the NPE