Fixed ohiggins' #81396 and #81367, and minem's #80359