Updated code from master branch.