Fixed buggy replacement order