misc fixes in generator - negative indexes