Fix NullPointerException if unloading too fast