megre from 0.90 branch