fix UT errors, avoid NPE for methods called by UT