Fix some bugs on files