Fix style and a bug with detection on the LINQ statement