Added patch from Davide.