some fix for fitGridFromSize
master was pulledl