Fixed incorrect 'replace' rather than 'add' behaviour