Trying to fix period casting bug, not sure how this has affected the analysis