Merging changes from snapshot_3.0.9 to fix bug #2235