Added compatability for "file" objects.