Fix a remote parsing bug (with tests)