diff --git a/ppd/PPD.pm b/ppd/PPD.pm
index 4f983140d61769933e8cebf1624ee44bc7f5d9fd..164320fe327cd040d242a43852093103958de35d 100644
--- a/ppd/PPD.pm
+++ b/ppd/PPD.pm
@@ -392,7 +392,6 @@ declare('d',
 define_head_group({ Key => 'c', Name => 'CUPS options' });
 declare('c',
 	[ 'cupsFilter',			's',	undef ],
-	[ 'cupsProtocol',		's',	undef ],
 );
 
 # Group "j": JCL options
@@ -569,7 +568,7 @@ sub generate() {
 	check_missing();
 
 	print "*PPD-Adobe: ", format_value('q', get('FormatVersion')), "\n";
-	print "*% PPD file generated by UCW PPD generator\n";
+	print "*% PPD file generated by KAM PPD generator\n";
 
 	for my $g (@head_groups, @ui_groups, @nonui_groups) {
 		emit_group($groups{$g});
diff --git a/ppd/PPD/PJL.pm b/ppd/PPD/PJL.pm
index 4019e89483706f3ef96d84419a454b9ddf37e497..b90842d257a5bff05662742ea274a57dfc2f5165 100644
--- a/ppd/PPD/PJL.pm
+++ b/ppd/PPD/PJL.pm
@@ -5,7 +5,7 @@ our @EXPORT = qw(jopt);
 
 use PPD;
 
-sub add_jcl($) {
+sub add_jcl(;$) {
 	my $opt = $_[0] // {};
 	set('JCLBegin', '<1B>%-12345X@PJL<0A>');
 	set('JCLToPSInterpreter', '@PJL ENTER LANGUAGE = POSTSCRIPT<0A>');
diff --git a/ppd/gen-priserka b/ppd/gen-priserka
index 2dfd60305cd00ddcf5240e0aa815e173ff5637d0..967f9cafeb26e83ff1409fe7d6a0f44187200926 100755
--- a/ppd/gen-priserka
+++ b/ppd/gen-priserka
@@ -22,7 +22,7 @@ set('Protocols', 'PJL BCP TBCP');
 set('FileSystem', 1);
 set('AccurateScreensSupport', 1);
 
-set('cupsProtocol', 'None');
+set('cupsFilter', 'application/vnd.cups-postscript 0 /aux/root/xerox-acct');
 
 define_ui_group({ Key => 'Basic', Name => 'Basic options' });
 
@@ -34,9 +34,12 @@ PPD::PJL::add_jcl();
 PPD::Paper::add_papers({
 	MinW => 252, MaxW => 864,
 	MinH => 278, MaxH => 1368,
-	MarginH => 11.62, MarginV => 11.62,	# FIXME: show as floats
-	PSPageSize => sub { my ($m) = @_; return sprintf("<< /PageSize [%d %d] >> setpagedevice", $m->{W}, $m->{H}); },
-	# FIXME: LeadingEdge
+	MarginH => 11.62, MarginV => 11.62,
+	PSPageSize => sub {
+		my ($m) = @_;
+		return sprintf("<< /PageSize [%d %d] >> setpagedevice", $m->{W}, $m->{H})
+			. ($m->{W} > 620 ? " userdict /XRXShortEdgeFinishing true put" : "");
+	},
 });
 switch_group('Media');
 
@@ -120,16 +123,17 @@ option({
 	],
 });
 
+# This is very similar to *LeadingEdge, but the semantics are subtly different,
+# so we prefer to use a different name.
 option({
-	Key => 'XRFeedEdge',
-	Name => 'Tray 5 (Bypass) Feed Edge',
+	Key => 'XRFeed',
+	Name => 'Feed Orientation',
 	Choice => 'PickOne',
 	Priority => 31,
 	Values => [
-		{ Key => 'LongEdge', Name => 'Long Edge Feed',
-		  PS => 'currentpagedevice /ManualFeed get { << /LeadingEdge 1 >> setpagedevice } if' },
-		{ Key => 'ShortEdge', Name => 'Short Edge Feed',
-		  PS => 'currentpagedevice /ManualFeed get { << /LeadingEdge 0 >> setpagedevice } if' },
+		{ Key => 'AutoSelect', Name => 'Automatically Select', PS => "" },
+		{ Key => 'LongEdge', Name => 'Long Edge First', PS => '<< /LeadingEdge 1 >> setpagedevice' },
+		{ Key => 'ShortEdge', Name => 'Short Edge First', PS => '<< /LeadingEdge 0 >> setpagedevice' },
 	],
 });
 
@@ -184,7 +188,6 @@ option({
 		  PS => 'userdict /XRXShortEdgeFinishing known ' .
 		        '{ << /Collate true /Staple 3 /LeadingEdge 0 /StapleDetails << /Type 7 /Location 5 >> >> setpagedevice } ' .
 		        '{ << /Collate true /Staple 3 /LeadingEdge 1 /StapleDetails << /Type 7 /Location 6 >> >> setpagedevice } ifelse' },
-		# FIXME: Set XRXShortEdgeFinishing
 	],
 });
 
@@ -208,31 +211,6 @@ option({
 
 # FIXME: XRFrontCoverSheet, XRBackCoverSheet, XRSlipSheetPrint, XRSlipSheetSource
 
-# FIXME: Update
-constrain(undef, 'InputSlot', 'MediaType', sub {
-	my ($is, $mt) = @_;
-	return !(($is eq 'Tray2' || $is eq 'Tray3') &&
-		 ($mt eq 'Labels' || $mt eq 'Envelope'));
-});
-
-constrain(undef, 'Duplex', 'MediaType', sub {
-	my ($dp, $mt) = @_;
-	return !($dp ne 'None' && $mt =~ /^(Labels|Transparency|Bond)$/);
-});
-
-# FIXME: Replace by XRXMismatch
-#option({
-#	Key => 'HPPaperPolicy',
-#	Name => 'Fit to Page',
-#	Choice => 'PickOne',
-#	Priority => 10,
-#	Values => [
-#		{ Key => 'PromptUser', Name => 'PromptUser', PS => '', Default => 1 },
-#		{ Key => 'NearestSizeAdjust', Name => 'Nearest Size and Scale', PS => '<< /Policies << /DeferredMediaSelection true /PageSize 3 >> >> setpagedevice' },
-#		{ Key => 'NearestSizeNoAdjust', Name => 'Nearest Size and Crop', PS => '<< /Policies << /DeferredMediaSelection true /PageSize 5 >> >> setpagedevice' },
-#	],
-#});
-
 define_ui_group({ Key => 'Quality', Name => 'Print Quality' });
 
 option({
@@ -241,7 +219,7 @@ option({
 	Choice => 'Boolean',
 	Priority => 70,
 	Values => [
-		{ Key => 'False', Name => 'Off', PS => '<< /PostRenderingEnhanceDetails << /Type 32 /TonerSaver 0 >> setpagedevice', Default => 1 },
+		{ Key => 'False', Name => 'Off', PS => '<< /PostRenderingEnhanceDetails << /Type 32 /TonerSaver 0 >> setpagedevice' },
 		{ Key => 'True', Name => 'On', PS => '<< /PostRenderingEnhanceDetails << /Type 32 /TonerSaver 1 >> setpagedevice' },
 	],
 });
@@ -268,7 +246,6 @@ option({
 	Values => [
 		{ Key => '600dpi', Name => '600 DPI (Fast)',
 		  PS => '<< /HWResolution [600 600] /DeviceRenderingInfo << /Type 26 /ValuesPerColorComponent 2 >> >> setpagedevice',
-		  Default => 1,
 		},
 		{ Key => '1200dpi', Name => '1200 DPI (High Quality)',
 		  PS => '<< /HWResolution [1200 1200] /DeviceRenderingInfo << /Type 26 /ValuesPerColorComponent 2 >> >> setpagedevice'
@@ -431,4 +408,28 @@ ZapfChancery-MediumItalic: Standard "(003.000)" Standard ROM
 ZapfDingbats: Special "(002.000)" Special ROM
 AMEN
 
+# Various constraints
+
+# FIXME
+#constrain(undef, 'Duplex', 'PageSize', sub {
+#	my ($dp, $ps) = @_;
+#	return !($dp ne 'None' && $ps !~ /^(Env.*|)$/);
+#});
+
+constrain(undef, 'Duplex', 'MediaType', sub {
+	my ($dp, $mt) = @_;
+	return !($dp ne 'None' && $mt =~ /^(Labels|Transparency|Bond|CardStock|ExtraHeavyweight|Envelopes|Standard2)$/);
+});
+
+# FIXME
+#constrain(undef, 'StapleLocation', 'PageSize', sub {
+#	my ($dp, $ps) = @_;
+#	return !($dp ne 'None' && $ps !~ /^(Env.*|)$/);
+#});
+
+constrain(undef, 'StapleLocation', 'MediaType', sub {
+	my ($st, $mt) = @_;
+	return !($st ne 'None' && $mt =~ /^(Labels|Transparency|Envelopes)$/);
+});
+
 generate();