fix exception when using use_sample_val in parameter.py

- also updated some docstrings