Fixes grid printing bug(use correct dimension).