Delete invalid references to obsoleted files
Some helper functions for streaming