Fix RPC port, Windows and Mac OSX build