Fixed error when a file was removed from filesystem. Fixed #1120.