Allow 1 byte R/S as per comments

Putting the code inline with the comments and fixing bounds checking