Finally patched up file object issues