Fixed bug writing BTX0 files