Checking reference errors when editing