Fix binary transfer of parameters / make it more robust