fixing gyp dependencies and remove unused variables; also fix bad initialization order in sub_client