few fixes to polygon indexing