Report errors when reading and writing network data
Code cleanup