Cperello/samba fixes

This fixes the LDAPI problem I introduced with latest merge into master.