under Gustaf IV Adolfs regering.