Fix assets replacement code