Fix a test problem and fix an NPE.