Apply patch from Timo