Various changes mostly to handling of parameter binding; some changes to model also