gep refinement
merged and compatible with 3.4svn