Added replace methods for arrays