Some bug fixes for row logic