patch from edd@, committed by me since we're running out of time. sorry edd for not checking this earlier.