fix bugs in variance checking resulting from refactored parameter model
including #782, and add missing tests
minor