Properly encode and decode arguments