This should fix both issues, and some others I noticed
https://github.com/discourse/discourse/pull/31100