Fix handling files