Fix flat detection