fixed up file entity and added tests