Fixed encoding of command arrays (fixes #112).