Fix Coverity reported bugs: uninit var and illegal dereferencing.
Add expression sampling tests.
Merge branch 'develop' into coverity-scan