--distance gz/bin writing bugfix