Bug fixes in the dump method