metadata: Fix inverted logic in metadata update function