Changes made to fold, fromfile, and filehandlers in order to debug