Fix NPE in tick handler.