Most important fix based on answer from windstaerke1111.