Fixes for rand() and octet_length()

Rand needed to be a floating-point value between 0.0 and 1.0, octect_length() shouldn't count the number of characters, its supposed to be the number of bytes