Fixed packet build functions and byte order conversion functions