Fixed endianness, and added number of tracks to header.