diff --git a/checks/manpages b/checks/manpages
index 94ebdb3..c379f0c 100644
--- a/checks/manpages
+++ b/checks/manpages
@@ -24,7 +24,7 @@ use warnings;
 
 use Lintian::Check qw(check_spelling);
 use Lintian::Tags qw(tag);
-use Lintian::Util qw(clean_env fail);
+use Lintian::Util qw(clean_env fail open_gz);
 
 use Text::ParseWords ();
 use File::Basename;
@@ -161,11 +161,18 @@ foreach my $file ($info->sorted_index) {
         }
     } else { # not a symlink
         my $path = $info->unpacked($file);
-        open (MANFILE, '-|', "zcat \Q$path\E 2>/dev/null")
-            or fail("cannot open $file: $!");
+        my $fd;
         my @manfile = ();
-        while (<MANFILE>) { push @manfile, $_; }
-        close MANFILE;
+        if ($file_info =~ m/gzip compress/o) {
+            $fd = open_gz ($path)
+                or fail("cannot open $file: $!");
+        } else {
+            open $fd, '<', $path
+                or fail("cannot open $file: $!");
+        }
+
+        while (<$fd>) { push @manfile, $_; }
+        close $fd;
         # Is it a .so link?
         if ($index_info->size < 256) {
             my ($i, $first) = (0, '');
@@ -233,22 +240,38 @@ foreach my $file ($info->sorted_index) {
         # parent directory before running man so that .so directives are
         # processed properly.  (Yes, there are man pages that include other
         # pages with .so but aren't simple links; rbash, for instance.)
-        my $cmd;
+        my @cmd = ('man', '--warnings', '-E', 'UTF-8', '-l', '-Tutf8', '-Z');
+        my $dir;
         if ($path =~ m,^(.*)/(man\d/.*)$,) {
-            $cmd = "cd \Q$1\E && man --warnings -E UTF-8 -l \Q$2\E";
+            push @cmd, $2;
+            $dir = $1;
         } else {
-            $cmd = "man --warnings -E UTF-8 -l \Q$path\E";
+            push @cmd, $path;
         }
-        my $pid = open MANERRS, '-|';
+        my ($read, $write);
+        pipe ($read, $write) or fail "pipe failed: $!";
+        my $pid = fork;
         if (not defined $pid) {
-            fail("cannot run man -E UTF-8 -l: $!");
+            fail "fork: $!";
         } elsif ($pid == 0) {
             clean_env;
+            close STDOUT;
+            close $read;
+            open STDERR, '>&', $write
+                or fail "Redirecting STDERR to STDERR: $!";
+            if ($dir) {
+                chdir $dir or fail "chdir $dir: $!";
+            }
             $ENV{MANWIDTH} = 80;
-            exec "($cmd >/dev/null) 2>&1"
+            $ENV{MANROFFSEQ} = '';
+            exec { $cmd[0] } @cmd
                 or fail("cannot run man -E UTF-8 -l: $!");
+        } else {
+            # close write end
+            close $write;
         }
-        while (<MANERRS>) {
+
+        while (<$read>) {
             # ignore progress information from man
             next if /^Reformatting/;
             next if /^\s*$/;
@@ -271,7 +294,7 @@ foreach my $file ($info->sorted_index) {
             tag 'manpage-has-errors-from-man', $file, $_;
             last;
         }
-        close(MANERRS);
+        close $read;
         # Now we search through the whole man page for some common errors
         my $lc = 0;
         my $hc = 0;
