Fixed bug where row bound was not properly checked