Some minor code simplify and extra test
minor #757 Some minor code simplify and extra test (keradus)

This PR was merged into the 1.2-dev branch.

Discussion
----------

Some minor code simplify and extra test

Commits
-------

2666919 Some minor code simplify and extra test