Fixing contract violations