Fix scripts to handle missing data
Fix issue with no sleep records