FIX: Prevent duplicate flags after undoing on the server side too.