Add test to check return value in case of incorrect bytes sent