NPE and cleanup from analyze