fix small mistakes

fix endian mistakes, mistaken word length and preprocessor mistake