Fixed NPE on multiple calls to dispose()