Fix type mis-match and lack of stdint.h needed to properly use uint8_t