Correct some behavior with normalize_to_epoch and add tests