Fixed all compiled errors except those in bwape.c. Fixed struct field alignment problems in bwtio.c.