Changed the names of variables in fileref deletion to be more explicit
Fixed a bug in fileref upload error handling