Code cleanup and minor bug fixes for model parameter sets.