Fixed issues with grid layout.