Unit tests and bug fixes for the parameter negotiation process.