fix error reporting when a stream cannot be written
fix handling of unsatisfiable ranges
fix responses for empty files