Added file modification methods and bugfixes