Write binary files correctly.