Fix handling of NaN and missing rows
Merge branch 'master' into release