Fix compile errors, reduce imports
put brackets back on if statements
manually merge PR #166
Merge pull request #180 from lyqyd/master

Manually merge Engineer's PR #166.