Fixed bug on checking files.