fix typo in stuff_to_do (resulting in nothing being done ...)
avoid some warnings by checking that chunk is not all NAs