Fix #400, Fix #402, Fix deletion of File type