Updates from @Jearil, pull request #4408ded