fix 945 by parse fn, 1117 by using better input way
Merge pull request #41 from huangnoah/fix-20130111

fix 945 by parse fn, 1117 by using better input way