Added sanity checking. Fixed symbolic link removal.