Fixed bug in restrict grid where x was not reset after each row iteration