Update arg parsing code to use "gsub" instead of "sub"