Fix an exception thrown when searching for accounts