Fix casting of params/responses