model params and cookie encoding fixes