This is the rest of the patch from Francisco Alcoba.