cleanup patch; add test for remote connection initialization