patch from Trac