Fixed replace bug, push guards after header