Added ability to separate grid and border drawing.