File improvements, some fixes