Fix package checking. Extract 'isMissing' function