Should return 0 rather than nan

when there's nothing in the table.