Fix grid renderer for non-perfect grid divisions