Check for possible NPE. Synchronized thread local cleanup.