Samba fixes

Some small fixes for warnings and copies of files being inefficient.