Fix rows and column checking