Merge branch 'master' into optexp
small changes on g2e.c
small optimization for gradients
small optimization
Merge branch 'optexp'