fixed the s_len issue. Was reading it into char instead of unsigned char cause i'm  stupid...stupid...STUPID...