Fix handling empty file