Fixed a bug in shapes.__generate_grid_from_string. 

The function didn't work in serial mode.