Add offset to grid generator, fix #1