fix #1503
more gii improvements
Merge pull request #1507 from chemezov/fix-1503

Fix 1503