NPH fix: prevent offsets from going over period limit