Fix format validation helper