several bug fixes related to winbind