Fixed ohiggins' #81396 and minem's #80359