Enable O1

This PR fix the problem in  #29.  But need more tests and experiments.