Changes from ruih/master branch.