Fix derived types missing pattern restrictions