Replace server, port for uri and fix deficiencies