Fixed logic in timestamp validation.