Minor changes and a context manager.