fix #30, #27
Merge pull request #31 from xiechao06/issue30

fix #30, #27
fix the compatility bug
Merge remote-tracking branch 'origin/master' into dev
merge from master