Errors fixed in getReplacementNodes