Fix returned value and vector clock update