Fix provided by Robin Munn <rmunn@pobox.com>