Add replace pattern spec. Fix new entry, and replace pattern commands.