Do not use deprecated calls for head/tail, fix man page detection