Apply patch from Paul Hampson <Paul.Hampson@Pobox.Com> to work for a