Try to fix test failures #557.
Address review comments. #557
Merge pull request #609 from fred-wang/preview

Preview