applied patch for SF bug #1297