wserial: fixes for return code