imapcheck: big fixes