fix handling of hidden elements by row, closes #28