Improve GPO code to be more robust
Included a missing use
fixed syntax
Merge pull request #627 from Zentyal/cperello/ticket-7265

Cperello/ticket 7265