Rewrite command arrays as strings