fix rcp header parse, add error checking in rcp_command()