Add precondition checks.