Fix NPE on dispose