Bug fixes to toParam()