Fixing issue with checking permissions when moving files.