Fix occasional NPE