Fixed getPair so it doesn't throw an exception.