Changed ordering of replacement