manual merge of @TheYosh 7bc8d4705adc83021c24d46e870f3151e7e723e5