Fixed a wrong usage of perl constants
Added tests
Merge pull request #478 from Zentyal/cperello/samba-fixes

Cperello/samba fixes