some updates

Replacing dereference of zero'th element by data();
Fixed issues in GridGen that prevented compilation by microsoft visual
studio compiler;
Fixed small bug introduced by previous commit.