rpcclient: fix variable initialisation and add parenthesis to if clauses