Merging changes from v0.6.2 branch.