Support both versions of replace, thanks tom/toby

Still not sure about optional args for ttl/idle