fixed several functions to be total
fixed one more function
Merge pull request #42 from yilongli/java_rewrite_engine

fixed several functions to be total