fixes for SF bug #257.