Added invariants to each method call.