minor bugfix to replaceecodes