Rookie mistake - gsub!'ed an input arg, sorry. Blew up on a frozen string, thank goodness.