--- ff12a_p3.c	Wed Jul 20 21:56:26 2016
+++ ff12a_p4.c	Sat Jul 23 14:50:12 2016
@@ -2430,7 +2430,7 @@
 				}
 #endif
 				if (i >= _MAX_LFN) { i = 0; break; }	/* No LFN if buffer overflow */
-				fno->fname[i++] = (char)w;
+				fno->fname[i++] = (TCHAR)w;
 			}
 			fno->fname[i] = 0;	/* Terminate the LFN */
 		}
@@ -3680,8 +3680,9 @@
 	FATFS *fs;
 	DWORD tm;
 	BYTE *dir;
+#if _FS_EXFAT
 	DEF_NAMBUF
-
+#endif
 
 	res = validate(fp, &fs);	/* Check validity of the object */
 	if (res == FR_OK) {
@@ -4008,6 +4009,9 @@
 
 	/* Normal Seek */
 	{
+#if _FS_EXFAT
+		if (fs->fs_type != FS_EXFAT && ofs >= 0x100000000) ofs = 0xFFFFFFFF;	/* Clip at 4GiB-1 if at FATxx */
+#endif
 		if (ofs > fp->obj.objsize && (_FS_READONLY || !(fp->flag & FA_WRITE))) {	/* In read-only mode, clip offset with the file size */
 			ofs = fp->obj.objsize;
 		}
