some cleanup
Fix bytes_written: we can boot now!