More tests for parameters module and fix a few bugs.