Fix placement of replacecheck initialization.