Added k support and bugfixes from alpha testing

Added support for each sub-parameter set to have it's own k.
3 Minor bug fixes from Omer's alpha testing.