Logical fixes in file comparison