Fix set constraints and nullness annotations