More cleanup: use wtf functions when possible.
Merge pull request #720 from zhenyao/clean

More cleanup: use wtf functions when possible.