Add test to check return value inc ase of incorrect bytes sent

Again - this will need rebasing once #3 and #4 are merged (or rejected). It's just the last commit that's new.