fixes #585 - gli 2.11 compatability
make the code a bit nicer
Merge pull request #586 from flapjack/585_gli_2.11_compat

gli 2.11 compatability