directories were not handled correctly

Hi Boris,

I made a small bug fix. When checking if the source is a directory or not, the symlink name was checked, which fails of course.

Cheers,
- Lars