r1570: merging changes from 3.0.5