Made dispose code robust to timeouts and throws on error, and added a test for a more complex read case