Error -50 when moving files

Had a strange problem when I was starting to move my files from the faulty NAS to my new NAS. I got Error -50 every time I tried to move directories, but files worked fine.

The problem seems to be that Apple (OSX) stores information in all directories in a hidden catalog called .AppleDouble.
After removing these catalogs it worked fine.

Open up a terminal and go to the directory where you have stored your files and run

find . -name ".AppleDouble" -type d -exec rm -rf {} \;

This will remove the .AppleDouble from all directories and its subdirectories.