Changed type of length argument from size_t to uint_8 as that is what it is specified